import request from '@/utils/request'

export function fetchList(query) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/mdlist",
        method: 'get',
        params: query
    })
}

export function uploadfile(data, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "v1/admin/uploadfile",
        method: 'post',
        data,
        headers
    })
}

//提交活动图图片
export function uploadActvieImg(data, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/apuploadfile",
        method: 'post',
        data,
        headers
    })
}


//提交活动
export function addActvie( headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/activepage",
        method: 'post',
        headers,
        data,
    })
}

//活动列表
export function activeList(headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/activepagelist",
        method: 'get',
        headers
    })
}

export function uploadNodefile(data, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "v1/admin/addorgnode",
        method: 'post',
        data,
        headers
    })
}

//添加页面
export function saveAdPage( headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "v1/admin/adpage",
        method: 'post',
        data,
        headers
    })
}

//取取视频列表,活动页面列表，取数据包列表
export function fetchVideoList(query, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/advideos",
        method: 'get',
        params: query,
        headers
    })
}
//活动页面列表
export function fetchAdPageList(query, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/adpages",
        method: 'get',
        params: query,
        headers
    })
}
//据包列表
export function fetchMdCrowdList(query, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/mdcrowds",
        method: 'get',
        params: query,
        headers
    })
}


export function uploadWxVideo(data, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "v1/admin/wxuploadvideo",
        method: 'post',
        data,
        headers
    })
}

export function uploadWxCrowd(data, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "v1/admin/wxuploadexcel",
        method: 'post',
        data,
        headers
    })
}

//添加广告
export function uploadAd(data, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "v1/admin/ad",
        method: 'post',
        data,
        headers
    })
}

//取组织
//据包列表
export function fetchOrgList() {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/orgnodelist",
        method: 'get'
    })
}

//批量导入工作人员
export function importtoworker() {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/importtoworker",
        method: 'get'
    })
}

//修改工作人员名字
export function updateUserName(data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/renamenode",
        method: 'post',
        data
    })
}

//替换工作人员名字/v1/admin/transformnode   {Fid Tid}
export function replaceUserName(data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/transformnode",
        method: 'post',
        data
    })
}

//领门店
export function mdaddorgid(headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/mdaddorgid",
        method: 'get',
        headers
    })
}


//改门店标记名
export function tagMdName(query, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/tagname",
        method: 'get',
        params: query,
        headers
    })
}


//广告帐号充值
export function adRecharge(query, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/adrecharge",
        method: 'get',
        params: query,
        headers
    })
}

//门店广告列表
export function fetchAdList(query, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/adlist",
        method: 'get',
        params: query,
        headers
    })
}


//门店广告帐号
export function AdAccountInfo(query, headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/adaccountinfo",
        method: 'get',
        params: query,
        headers
    })
}

//公司产品品牌筛选/v1/admin/setbrand    Brands []int64
export function chooseHeadProduct( headers,query) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/setbrand",
        method: 'get',
        headers,
        params: query
    })
}

//公司产品品牌筛选/v1/admin/setbrand    Brands []int64
export function addMdBrand( headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/setbrand",
        method: 'get',
        headers
    })
}

//公司产品品牌筛选/v1/admin/setbrand    Brands []int64
export function updateMdBrand( headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/setbrand",
        method: 'post',
        headers,
        data
    })
}

//门店商品列表
export function GoodsList(query) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/goodslist",
        method: 'get',
        params: query
    })
}

//门店商品基本信息
export function GoodsInfo(headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/goods",
        method: 'get',
        headers
    })
}

//更新和添加门店商品基本信息
export function updateGoodsInfo(headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/goods",
        method: 'post',
        headers,
        data
    })
}


//门店商品规格信息及规格key查看
export function GoodsKeys(headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/goodsspeclistoraddkey",
        method: 'get',
        headers
    })
}

//门店商品规格添加
export function addGoodsKeys(headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/goodsspeclistoraddkey",
        method: 'post',
        headers,
        data
    })
}
//门店规格对应的值添加  header:Goodsid   data:{Speckeyid,Specvalue}
export function addGoodsSpecKeys(headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/addgoodsspecvalue",
        method: 'post',
        headers,
        data
    })
}

//获取规格列表  data:{Specstr}  header:Goodsid sonstr := "1,1|1,2|1,3|1,25|1,26|5,4|5,5|5,6|6,10|6,11|6,12|6,13
export function goodsSpecList(headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/goodsspeclist",
        method: 'post',
        headers,
        data
    })
}

//规格价格更新
export function updatePrice(headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/ajaxupgoodsspecprice",
        method: 'post',
        headers,
        data
    })
}

//门店商品选中的排列组合
export function GoodsSpeckList( headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/goodsspeclist",
        method: 'post',
        data,
        headers
    })
}

//查看商品所以图片
export function goodsAllImgs( headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/select/goodsimgs",
        method: 'get',
        headers
    })
}

//添加图片 { Classname string Imgid int64 Name string}
export function addGoodsImg( headers,data ) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/imgsmanage",
        method: 'post',
        headers,
        data
    })
}

//删除图片data { Classname string Imgid int64 Name string}
export function removeImg(headers,data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/imgsmanage",
        method: 'delete',
        headers,
        data
    })
}

//获取样板间图片
export function roomImgList( headers) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/roomimg",
        method: 'get',
        headers
    })
}


//门店管理员列表
export function mdAdminList() {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/mdadminlist",
        method: 'get'
    })
}

//审核门店管理员
export function mdAdminAudit(data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/verifymdadmin",
        method: 'post',
        data
    })
}


//获取样板间列表
export function roomList() {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/room",
        method: 'get'
    })
}

//添加样板间
export function addRoom(data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/room",
        method: 'post',
        data
    })
}

//修改密码的用户
export function getPassUser() {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/setpassword",
        method: 'get'
    })
}

//修改密码的用户
export function updatePass(data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/setpassword",
        method: 'post',
        data
    })
}

///v1/admin/oosvideolist   get 视频列表
export function videoList() {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/oosvideolist",
        method: 'get'
    })
}

//上传视频/v1/admin/onevideotooos

export function addVideo(headers,data,) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/onevideotooos",
        method: 'post',
        headers,
        data
    })
}

//删除视频
export function deleteVideo(data) {
    return request({
        baseURL: "http://192.168.38.2:8091",
        url: "/v1/admin/onevideotooos",
        method: 'delete',
        data
    })
}

///v1/admin/apuploadfile 



